﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ManageStudentxm.aspx.cs" Inherits="Admin1_Default2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../css/admin.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .style2
        {
            width: 91px;
            text-align: right;
        }
        .style3
        {
            width: 91px;
            text-align: right;
            height: 46px;
        }
        .style4
        {
            height: 46px;
        }
        .style5
        {
            width: 91px;
            text-align: right;
            height: 41px;
        }
        .style6
        {
            height: 41px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <div class="m_box">
      <div class="m_head">考生信息</div>
      <div class="m_middle">
        <div class="m_m_c"></div>
        <div class="m_m_c">
            <span>查询条件 学生名字</span></div>  
        <div class="m_m_c">
            <asp:TextBox ID="TextBox1" runat="server" Width="139px" Height="20px"></asp:TextBox>

    <!--AutoCompleteExtender成員說明
    MinimumPrefixLength：最少輸入幾個字就呼叫Method
    TargetControlID：哪個TextBox要有自動完成功能
    ServiceMethod：呼叫的Method名
    ServicePath：WebService路徑
    CompletionSetCount：要列出幾筆資料
    -->

          </div>  
        <div class="m_m_c">
            <asp:ImageButton ID="ImageButton1" runat="server" 
                ImageUrl="~/image/search.gif" onclick="ImageButton1_Click" />
          </div>  
      </div>
      <div  style= "float:left">
          <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
              CellPadding="4" GridLines="Horizontal" 
              Height="35px" Width="615px" ForeColor="Black" 
              onpageindexchanging="GridView1_PageIndexChanging" 
              onrowdeleting="GridView1_RowDeleting" BackColor="White" 
              BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" 
              AllowPaging="True" 
              onrowcancelingedit="GridView1_RowCancelingEdit" onrowediting="GridView1_RowEditing" 
              onrowupdating="GridView1_RowUpdating" DataKeyNames="id" 
              ShowHeaderWhenEmpty="True" 
              onselectedindexchanged="GridView1_SelectedIndexChanged">
              <RowStyle HorizontalAlign="Center" /> 
              <Columns>
                  <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" 
                      ReadOnly="True" SortExpression="ID" Visible="False" />
                  <asp:BoundField DataField="bumenid" HeaderText="bumenid" 
                      SortExpression="bumenid" Visible="False" />
                  <asp:BoundField DataField="danweiid" HeaderText="danweiid" 
                      SortExpression="danweiid" Visible="False" />
                  <asp:BoundField DataField="danweimingchen" HeaderText="单位名称" 
                      SortExpression="danweimingchen" >
                  <ItemStyle Width="300px" />
                  </asp:BoundField>
                  <asp:BoundField DataField="bumenmingcheng" HeaderText="部门名称" 
                      SortExpression="bumenmingcheng" />
                  <asp:BoundField DataField="Name" HeaderText="姓名" SortExpression="Name" />
                  <asp:BoundField DataField="kaoshenghao" HeaderText="考生号" 
                      SortExpression="kaoshenghao" />
                  <asp:CommandField ShowDeleteButton="True" ShowSelectButton="True" />
              </Columns>
              <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
              <HeaderStyle BackColor="#3a9cff" Font-Bold="True" ForeColor="White" />
              <PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
              <RowStyle BackColor="White" ForeColor="#333333" />
              <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
          </asp:GridView>
          </div>
           <table style="width: 269px;float:left" >
              <tr>
                  <td class="style3">
                      部门：</td>
                  <td class="style4">
                      <asp:DropDownList ID="DropDownList1" runat="server" Height="36px" Width="148px">
                      </asp:DropDownList>
                  </td>
              </tr>
              <tr>
                  <td class="style5">
                      姓名：</td>
                  <td class="style6">
                      <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
                  </td>
              </tr>
              <tr>
                  <td class="style2">
                      &nbsp;</td>
                  <td>
                      <asp:Button ID="Button1" runat="server" Text="修改" onclick="Button1_Click" />
                  </td>
              </tr>
          </table>
     
      <div class="t_button">
          <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
              ConflictDetection="CompareAllValues" 
              ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
              DeleteCommand="DELETE FROM [Student] WHERE [ID] = ? AND (([Name] = ?) OR ([Name] IS NULL AND ? IS NULL)) AND (([kaoshenghao] = ?) OR ([kaoshenghao] IS NULL AND ? IS NULL)) AND (([danweiid] = ?) OR ([danweiid] IS NULL AND ? IS NULL)) AND (([bumenid] = ?) OR ([bumenid] IS NULL AND ? IS NULL))" 
              InsertCommand="INSERT INTO [Student] ([ID], [Name], [kaoshenghao], [danweiid], [bumenid]) VALUES (?, ?, ?, ?, ?)" 
              OldValuesParameterFormatString="original_{0}" 
              ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
              SelectCommand="SELECT a.[ID],a.bumenid,a.danweiid, a.[Name], a.[kaoshenghao], b.danweimingchen, c.bumenmingcheng FROM [Student] a,danwei b,bumeng c where a.danweiid=b.id and a.bumenid=c.id" 
              
              UpdateCommand="UPDATE [Student] SET [Name] = ?, [kaoshenghao] = ?, [danweiid] = ?, [bumenid] = ? WHERE [ID] = ? AND (([Name] = ?) OR ([Name] IS NULL AND ? IS NULL)) AND (([kaoshenghao] = ?) OR ([kaoshenghao] IS NULL AND ? IS NULL)) AND (([danweiid] = ?) OR ([danweiid] IS NULL AND ? IS NULL)) AND (([bumenid] = ?) OR ([bumenid] IS NULL AND ? IS NULL))">
              <DeleteParameters>
                  <asp:Parameter Name="original_ID" Type="Int32" />
                  <asp:Parameter Name="original_Name" Type="String" />
                  <asp:Parameter Name="original_Name" Type="String" />
                  <asp:Parameter Name="original_kaoshenghao" Type="String" />
                  <asp:Parameter Name="original_kaoshenghao" Type="String" />
                  <asp:Parameter Name="original_danweiid" Type="Int32" />
                  <asp:Parameter Name="original_danweiid" Type="Int32" />
                  <asp:Parameter Name="original_bumenid" Type="Int32" />
                  <asp:Parameter Name="original_bumenid" Type="Int32" />
              </DeleteParameters>
              <InsertParameters>
                  <asp:Parameter Name="ID" Type="Int32" />
                  <asp:Parameter Name="Name" Type="String" />
                  <asp:Parameter Name="kaoshenghao" Type="String" />
                  <asp:Parameter Name="danweiid" Type="Int32" />
                  <asp:Parameter Name="bumenid" Type="Int32" />
              </InsertParameters>
              <UpdateParameters>
                  <asp:Parameter Name="Name" Type="String" />
                  <asp:Parameter Name="kaoshenghao" Type="String" />
                  <asp:Parameter Name="danweiid" Type="Int32" />
                  <asp:Parameter Name="bumenid" Type="Int32" />
                  <asp:Parameter Name="original_ID" Type="Int32" />
                  <asp:Parameter Name="original_Name" Type="String" />
                  <asp:Parameter Name="original_Name" Type="String" />
                  <asp:Parameter Name="original_kaoshenghao" Type="String" />
                  <asp:Parameter Name="original_kaoshenghao" Type="String" />
                  <asp:Parameter Name="original_danweiid" Type="Int32" />
                  <asp:Parameter Name="original_danweiid" Type="Int32" />
                  <asp:Parameter Name="original_bumenid" Type="Int32" />
                  <asp:Parameter Name="original_bumenid" Type="Int32" />
              </UpdateParameters>
          </asp:SqlDataSource>
          <asp:HiddenField ID="HiddenField1" runat="server" />
      
          <asp:ImageButton ID="ImageButton3" runat="server" 
              ImageUrl="~/image/allselect.gif" onclick="ImageButton3_Click" />
          <asp:ImageButton ID="ImageButton2" runat="server" 
              ImageUrl="~/image/cselect.gif" onclick="ImageButton2_Click" />
          <asp:ImageButton ID="ImageButton4" runat="server" 
              ImageUrl="~/image/adelete.gif" onclick="ImageButton4_Click" />
        </div>
    </div>
    </form>
</body>
</html>
